package com.flyoil.petromp.mvp_p.ListPresenter;

import com.flyoil.petromp.base.BaseModel;
import com.flyoil.petromp.mvp_m.MatterModel.MatterFinishedListModel;
import com.flyoil.petromp.mvp_m.MatterModel.MatterUnFinishListModel;
import com.flyoil.petromp.mvp_p.Listener.BasePresenter;
import com.flyoil.petromp.mvp_v.ListUIView.BaseUIView;

import java.util.List;
import java.util.Map;

/**
 * Created by songzhiyin on 2017/10/31.
 * 已办事项、待办事项列表的逻辑处理类
 */

public class MatterListPresenter implements BasePresenter {
    private BaseUIView uiView;
    private BaseModel model;

    public MatterListPresenter(BaseUIView baseUIView, String type) {
        this.uiView = baseUIView;
        if (type.equals("1")) {
            model = new MatterUnFinishListModel();
        } else {
            model = new MatterFinishedListModel();
        }
    }


    @Override
    public void onsucced(List data) {
        uiView.updataToUI(data);
    }

    @Override
    public void initNetworkData(Map<String, Object> map) {
        model.loadNetworkData(map, this);
    }
}
